import { SimpleMtEntity } from '../mt'

export interface LiveInfo {
	/** 是否会议直播 0-否; 1-是; */
	live: 0 | 1
	mts: LiveEntity[]
}
export interface LiveEntity extends SimpleMtEntity {
	/**用户token */
	user_token: string
	/**是否是游客 */
	guest: 0 | 1
}
export class Live {
	name: string
	account: string
	accountType: 1 | 4 | 5 | 6 | 7 | 8 | 2
	confE164?: string
	bitrate: number
	portrait: string
	mtType: number
	constructor(mt: LiveEntity) {
		this.name = mt.name
		this.account = mt.account
		this.accountType = mt.account_type || 5
		this.confE164 = mt.conf_e164
		this.bitrate = mt.bitrate
		this.portrait = mt.portrait
		this.mtType = mt.mt_type
	}
	get isSimpleCascade(): boolean {
		return this.mtType === 9
	}
	get isPhone(): boolean {
		return this.mtType === 3
	}
}
export interface LiveModel {
	mcc: Live
	live: {
		isGuest: boolean
		userCookie: string
	}
	status: {
		isMatchSearch: boolean
		isCalling: boolean
	}
}
